import request from '@/utils/request'

// 获取费用规则列表
export function getFeeRules(params) {
  return request({
    url: '/feeRules/getAllFeeRules',
    method: 'get',
    params
  })
}

// 新增费用规则
export function addFeeRule(data) {
  return request({
    url: '/api/feeRules',
    method: 'post',
    data
  })
}

// 更新费用规则
export function updateFeeRule(id, data) {
  return request({
    url: `/api/feeRules/${id}`,
    method: 'put',
    data
  })
}

// 删除费用规则
export function deleteFeeRule(id) {
  return request({
    url: `/api/feeRules/${id}`,
    method: 'delete'
  })
}

// 获取商家入驻时间对应的费率
export function getMerchantRate(merchantId) {
  return request({
    url: `/api/feeRules/merchant/${merchantId}`,
    method: 'get'
  })
}

// 获取骑手费率
export function getRiderRate() {
  return request({
    url: '/api/feeRules/rider',
    method: 'get'
  })
} 